package com.example.simin_manage.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.simin_manage.entity.SysUser;
import com.example.simin_manage.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @description:
 * @author: panpan
 * @time: 2025/9/14
 */
@RestController
@RequestMapping("/api/dept")
public class DeptController {

    @Autowired
    private SysUserMapper userMapper;

    @GetMapping("/{deptId}/members")
    public List<SysUser> getMembers(@PathVariable Long deptId) {
        return userMapper.selectList(
                new QueryWrapper<SysUser>().eq("dept_id", deptId)
        );
    }
}
